import React, { Component } from "react";
class SetState extends Component {
  state = { done: true, content: "<h2>哈哈</h2>" };
  handleClick() {
    this.setState({ done: !this.state.done });
  }
  render() {
    const { done, content } = this.state;
    return (
      <>
        <div>
          <button onClick={this.handleClick.bind(this)}>点我</button>
        </div>
        {<h1>hello,{done ? "张三" : "React"}</h1>}
        <div dangerouslySetInnerHTML={{ __html: content }}></div>
      </>
    );
  }
}
class App extends Component {
  render() {
    return (
      <>
        <SetState></SetState>
      </>
    );
  }
}
export default App;
